#!/bin/sh
#  prepare.sh --- Time-stamp: <2008-10-11 20:14:53 root>
#  Copyright 2008 Julian Qian
#  Author: root@localhost.localdomain
#  Version: $Id: prepare.sh,v 0.0 2008/10/06 04:58:11 root Exp $
#  Keywords: 

# set -x

SHM_DEV=/dev/shm/ehome

if [ ! -f $SHM_DEV ];
then
	touch $SHM_DEV
	echo "Create SHM device."
fi

SYSLOG_CONF=/etc/syslog.conf
EHOME_LOG=`grep -c local0 $SYSLOG_CONF`
if [ $EHOME_LOG -eq 0 ];
then
	echo "# ehomed log file" >> $SYSLOG_CONF
	echo "local0.*					/var/log/ehomed.log" >> $SYSLOG_CONF
	echo "Update $SYSLOG_CONF."
fi

CONF_FILE=/etc/ehomed.conf
if [ ! -f $CONF_FILE ];
then
	cp config.ini $CONF_FILE
	echo "Generate config file $CONF_FILE"
fi
	